using System.Collections;
using System.Collections.Generic;
using TMPro;
using UnityEngine;

public class textshow : MonoBehaviour
{
    // Start is called before the first frame update
    private TMP_Text text;

    void Start()
    {
        text= GetComponent<TMP_Text>();
        gameObject.SetActive(false);
        事件管理器.AddListener(EventType.textshowme, showtext);
        //事件管理器.AddListener<string>(EventType.textshowme, showme);
    }

    private void OnDestroy()
    {
        事件管理器.RemoveListener(EventType.textshowme, showtext);
        //事件管理器.RemoveListener<string>(EventType.textshowme, showme);
    }

    // Update is called once per frame
    void Update()
    {
        
    }
    private void showtext()
    {

        gameObject.SetActive(true);
        text.text = textbt.instance.text;
    }
    private void showme(string a)
    {
        gameObject.SetActive(true);
        text.text = a;
    }
}
